$(document).ready(function() {
	$('#sampleForm').submit(
		function(event) {
			var firstname = $('#firstname').val();
			var lastname = $('#lastname').val();				
			var data = 'firstname='
					+ encodeURIComponent(firstname)
					+ '&amp;lastname='
					+ encodeURIComponent(lastname);
			$.ajax({
				url : $("#sampleForm").attr("action"),
				data : data,
				type : "GET",
 
				success : function(response) {
					alert( response );
				},
				error : function(xhr, status, error) {
					alert(xhr.responseText);
				}
			});
			return false;
		});
	});

function checkExistedRestaurantName() {
    $.ajax({
        url : 'web-admin/restaurant/checkexistedrestaurant',
        success : function(data) {
            $('#result').html(data);
        }
    });
}

function checkExistedRestaurantName() {
    $.ajax({
        url : 'web-admin/restaurant/checkexistedrestaurant',
        type: "GET",
        success : function(data) {
            alert("Hello");
        }
    });
}

function checkExistedRestaurantName() {
    $.ajax({
        url : "/restaurant/checkexistedrestaurant",
        type: "GET",
        success : function(response) {
            alert("Hello");
            return false;
        },
        error: function(e) {
        	alert("Error" + e);
        }
    });
}